home *** CD-ROM | disk | FTP | other *** search
- >For my particle engine, I'd like to add the ability for a user to load a
- >2-colour IFF of any size. Then, the program would randomly (or
- >not-so-randomly) set the particle positions where the pixels of the IFF are
- >not set to colour 0 (Black).
- >
- >1) Can I do it?
- >2) Can I get from a file the resolution of an IFF, colour depth, etc.
- >3) How do I read the IFF into the computer if the resolution is greater
- >than the displayable screen (one pixel at a time)?
-
- Yes, yes, and not easily; but there's a simple way to do it that doesn't
- require knowing the IFF format. Load the picture like this:
-
- Auto View Off : Rem So the user doesn't see the picture
- Load Iff PICTURE_FILE$,7 : Rem Load the picture into screen 7
- Screen Hide 7 : Rem So the screen doesn't show up later
- Auto View On: Rem Restore normal screen operation
-
- Now you have an invisible screen with the picture on it. You can use the
- Screen Width, Screen Height etc. commands to find out the screen geometry,
- and open another screen with the same values. Then all you have to do is
-
- Screen 7 : P=Point(X,Y) : Screen 0 : Plot X,Y,P
-
- Admittedly, this is not fast, but it's about all you're going to get out
- of AMOS.
-
- --Andy Church
-
-